/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jhu.profiteer.data;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author Jeremy
 */
@Entity
@Table(name="ACharacter")
public class Character implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Long id;
  private Long accountId;
  private String name;
  private String description;
  private Long currentLocationId;
  private Long money;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (null != id ? id.hashCode() : 0) +
            (null != accountId ? accountId.hashCode() : 0) +
            (null != name ? name.hashCode() : 0) +
            (null != description ? description.hashCode() : 0) +
            (null != currentLocationId ? currentLocationId.hashCode() : 0) +
            (null != money ? money.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    if (!(object instanceof Character)) {
      return false;
    }
    Character other = (Character) object;
    if ((null == this.id && null != other.id) ||
        (null != this.id && !this.id.equals(other.id))) {
      return false;
    }
    if ((null == this.accountId && null != other.accountId) ||
        (null != this.accountId && !this.accountId.equals(other.accountId))) {
      return false;
    }
    if ((null == this.name && null != other.name) ||
        (null != this.name && !this.name.equals(other.name))) {
      return false;
    }
    if ((null == this.description && null != other.description) ||
        (null != this.description &&
         !this.description.equals(other.description))) {
      return false;
    }
    if ((null == this.currentLocationId && null != other.currentLocationId) ||
        (null != this.currentLocationId &&
         !this.currentLocationId.equals(other.currentLocationId))) {
      return false;
    }
    if ((null == this.money && null != other.money) ||
        (null != this.money && !this.money.equals(other.money))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "jhu.profiteer.data.Character[id=" + id +
           ", accountId=" + accountId +
           ", name=" + name +
           ", description=" + description +
           ", currentLocationId=" + currentLocationId +
           ", money=" + money + "]";
  }

  /**
   * @return the accountId
   */
  public Long getAccountId() {
    return accountId;
  }

  /**
   * @param accountId the accountId to set
   */
  public void setAccountId(Long accountId) {
    this.accountId = accountId;
  }

  /**
   * @return the name
   */
  public String getName() {
    return name;
  }

  /**
   * @param name the name to set
   */
  public void setName(String name) {
    this.name = name;
  }

  /**
   * @return the description
   */
  public String getDescription() {
    return description;
  }

  /**
   * @param description the description to set
   */
  public void setDescription(String description) {
    this.description = description;
  }

  /**
   * @return the currentLocationId
   */
  public Long getCurrentLocationId() {
    return currentLocationId;
  }

  /**
   * @param currentLocationId the currentLocationId to set
   */
  public void setCurrentLocationId(Long currentLocationId) {
    this.currentLocationId = currentLocationId;
  }

  /**
   * @return the money
   */
  public Long getMoney() {
    return money;
  }

  /**
   * @param money the money to set
   */
  public void setMoney(Long money) {
    this.money = money;
  }

}
